#:import ImageButton ui.base.button
#:import MusicSlider ui.base.slider
#:import UIMix ui.base.UIMix

<PlayGrid>:
    orientation: 'vertical'
    canvas.before:
        Color:
            rgba: 0, 0, 0, 1
        Rectangle:
            pos:self.pos
            size:self.size
    padding: 10
    size_hint: 1, None
    height: 210

    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: 13/255, 13/255, 13/255, 1
            Rectangle:
                pos:self.pos
                size:self.size
        padding: 6
        size_hint: 1, None
        height: 132

        BoxLayout:
            size_hint: 1, None
            height: 40
            padding: 8
            spacing: 20
            Image:
                id: id_state_icon
                size_hint:None, None
                size: 30, 30
                source: root.x_icon
                pos_hint: {'center_y': 0.5}
            Label:
                id: id_file_name_text
                text: '音频文件名称'
                halign: 'center'
                font_size: UIMix.PlayGrid.font_size1
                text_size: self.size
                shorten: True
                shorten_from:'right'
            ImageButton:
                source: root.x_close_icon
                size:20, 20
                opacity: 1 if root.index !=0 else 0
                on_release: root.on_close_self(self)
        BoxLayout:
            size_hint: 1, None
            height: 40
            MusicSlider:
                id: id_play_slider

        BoxLayout:
            size_hint: 1, None
            height: 40
            MyMsYhLabel:
                size_hint: 0.26, 1
                font_size: UIMix.PlayGrid.font_size1
                text: root.text_current_music_play_time
            BoxLayout:
                size_hint: 0.41, 1
                spacing: 12
                Widget
                ImageButton:
                    source: root.fast_rewind_icon
                    size:30, 30
                    on_release: root.on_fast_rewind()
                ImageButton:
                    id: id_pause_or_proceed_button
                    source: root.play_icon
                    size:30, 30
                    on_release: root.on_pause_or_proceed()
                ImageButton:
                    source: root.fast_forward_icon
                    size:30, 30
                    on_release: root.on_fast_forward()
                Widget
            MyMsYhLabel:
                size_hint: 0.33, 1
                id: id_music_length_text
                valign: 'center'
                font_size: UIMix.PlayGrid.font_size1

    BoxLayout:
        size_hint: 1, None
        height: 58
        spacing: 40
        padding: 40, 10, 40, 14
        MyMsYhButton:
            text: '清除音频'
            on_release: root.clear_audio()
        MyMsYhButton:
            text: '添加音频'
            on_release: root.add_audio()